package com.task.manage.system.service.impl;

import java.util.List;

import com.task.manage.common.utils.DateUtils;
import com.task.manage.system.domain.req.StatisticsReqBO;
import com.task.manage.system.domain.resp.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.task.manage.system.mapper.TaskManageMapper;
import com.task.manage.system.domain.TaskManage;
import com.task.manage.system.service.ITaskManageService;
import com.task.manage.common.core.text.Convert;

/**
 * 任务管理器Service业务层处理
 *
 * @author ruoyi
 * @date 2024-05-10
 */
@Service
public class TaskManageServiceImpl implements ITaskManageService {
    @Autowired
    private TaskManageMapper taskManageMapper;

    /**
     * 查询任务管理器
     *
     * @param id 任务管理器主键
     * @return 任务管理器
     */
    @Override
    public TaskManage selectTaskManageById(Long id) {
        return taskManageMapper.selectTaskManageById(id);
    }

    /**
     * 查询任务管理器列表
     *
     * @param taskManage 任务管理器
     * @return 任务管理器
     */
    @Override
    public List<TaskManage> selectTaskManageList(TaskManage taskManage) {
        return taskManageMapper.selectTaskManageList(taskManage);
    }

    /**
     * 新增任务管理器
     *
     * @param taskManage 任务管理器
     * @return 结果
     */
    @Override
    public int insertTaskManage(TaskManage taskManage) {
        taskManage.setCreateTime(DateUtils.getNowDate());
        return taskManageMapper.insertTaskManage(taskManage);
    }

    /**
     * 修改任务管理器
     *
     * @param taskManage 任务管理器
     * @return 结果
     */
    @Override
    public int updateTaskManage(TaskManage taskManage) {
        taskManage.setUpdateTime(DateUtils.getNowDate());
        return taskManageMapper.updateTaskManage(taskManage);
    }

    /**
     * 批量删除任务管理器
     *
     * @param ids 需要删除的任务管理器主键
     * @return 结果
     */
    @Override
    public int deleteTaskManageByIds(String ids) {
        return taskManageMapper.deleteTaskManageByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除任务管理器信息
     *
     * @param id 任务管理器主键
     * @return 结果
     */
    @Override
    public int deleteTaskManageById(Long id) {
        return taskManageMapper.deleteTaskManageById(id);
    }

    /**
     * 查询管理器列表信息
     * @param taskManage
     * @return
     */
    @Override
    public List<TaskManageResp> selectMangeInfoList(TaskManageReqBO taskManage) {
        return taskManageMapper.selectMangeInfoList(taskManage);
    }

    @Override
    public List<RecoryTaskResp> selectMangeListByIdList(List<Long> idsList) {

        return taskManageMapper.selectMangeListByIdList(idsList);
    }

    @Override
    public List<TaskManage> selectTaskManageByIds(List<Long> idsList) {
        return taskManageMapper.selectTaskManageByIds(idsList);
    }

    @Override
    public List<TaskManageCopyResp> selectCopyInfoList(List<Long> idsList) {
        return taskManageMapper.selectCopyInfoList(idsList);
    }

    @Override
    public void updateBatchTaskManage(List<Long> idsList) {
        taskManageMapper.updateBatchTaskManage(idsList);
    }

    @Override
    public void updateBatchBatchEvaluate(List<Long> idsList,String type) {
        taskManageMapper.updateBatchBatchEvaluate(idsList,type);
    }

    @Override
    public void updateBatchTaskCopyManage(List<Long> idsList) {
        taskManageMapper.updateBatchTaskCopyManage(idsList);
    }

    @Override
    public StatisticsResp statisticsData(StatisticsReqBO statisticsReqBO) {
        return taskManageMapper.statisticsData(statisticsReqBO);
    }
}
